package ldkxingzhe.ldkxingzhedemo.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.TextView;

import ldkxingzhe.ldkxingzhedemo.R;
import ldkxingzhe.ldkxingzhedemo.utils.DemoGlobal;


/**
 * Created by ke on 15-9-4.
 */
public class DefStyleView extends TextView{

    private final String TAG = DefStyleView.class.getSimpleName();
    public DefStyleView(Context context) {
        super(context);
        Log.i(TAG,"constructor: DefStyleView(context)");
    }

    public DefStyleView(Context context, AttributeSet attrs) {
        this(context,attrs, 0);
        Log.i(TAG, "constructor: DefStyleView(context, attrs)");

    }

    public DefStyleView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        Log.i(TAG,"constructor: DefStyleView(context, attrs,defStyleAttr)");
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CustomizeDefStyleView,
                defStyleAttr,0);
        String attrOne = a.getString(R.styleable.CustomizeDefStyleView_attr_one);
        String attrTwo = a.getString(R.styleable.CustomizeDefStyleView_attr_two);
        boolean attrBoolean = a.getBoolean(R.styleable.CustomizeDefStyleView_attr_boolean, false);
        int attrInt = a.getInt(R.styleable.CustomizeDefStyleView_attr_int,-1);
        a.recycle();

        if(DemoGlobal.isDebug){
            Log.i(TAG, "attrOne = " + attrOne);
            Log.i(TAG, "attrTwo = " + attrTwo);
            Log.i(TAG, "attrBoolean = " + attrTwo);
            Log.i(TAG,"attrInt = " + attrInt);
        }
    }
}
